/*
 * @Description: 导航包裹组件
 * @Author: Rfan
 * @Date: 2022-10-29 15:50:22
 * @LastEditTime: 2022-10-29 16:55:24
 */

import { useBoxMgtContext } from '../contexts/BoxMgtContext';
import FolderTree from '@/components/FolderTree';
import UFANav, { IUFAChangeCallback } from '@/components/UFANav';

const NavSidebar = () => {
  const { setSelectFondId, setSelectAT, setSelectATId, setTreeNodeId } = useBoxMgtContext();

  const handleChange = ({ fondId, atId, atItem, nodeId }: any) => {
    setSelectFondId(fondId);
    setSelectAT(atItem);
    setSelectATId(atId);
    setTreeNodeId(nodeId);
  };

  const navChange = ({ fondId, fondItem, atId, atItem }: IUFAChangeCallback) => {
    console.log('change', { fondId, fondItem, atId, atItem });
    setSelectFondId(fondId);
    setSelectAT(atItem);
    setSelectATId(atId);
  };

  return (
    <>
      <UFANav onChange={navChange} />
      {/* <FolderTree onChange={handleChange} /> */}
    </>
  );
};

export default NavSidebar;
